/*Form Data*/
var miniform = null;
window.onload = function() {
   miniform = new mini.Form("form1");
}


function SetData(data) {
    $get("pid").value = data.Map.get("id");
    mini.get("pidName").setValue(data.Map.get("name"));

}

function SaveData() {
    SubmitForm("form1");
}

function onError(result) {
    mini.alert(result);
}

function onSaveSuccess(result) {
    mini.alert("Save Success", "Message", function() {CloseWindow("Save")});
}


function onOk(e) {
    SaveData();
}

/*Close WindowPanel*/
function onCancel(e) {
   CloseWindow("Cancel");
}

function CloseWindow(action) {
    if (window.CloseOwnerWindow) {
        window.CloseOwnerWindow(action);
    }else {
        window.close();
    }
}


